package org.dtrd.modules.food.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.food.entity.bean.CookbooksDetail;

import java.util.Date;


/**
 * <p>
 * 菜谱
 * </p>
 *
 * @author QR
 * @since 2021-12-09
 */
@Getter
@Setter
@TableName("dtrd_ext_ems_yw_cookbooks")
public class DtrdExtEmsYwCookbooks {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    /**
     * 菜品名称
     */
    @TableField("cook_name")
    private String cookName;

    /**
     * 菜品热量
     */
    @TableField("cook_kcal")
    private Integer cookKcal;

    /**
     * 脂肪/克
     */
    @TableField("cook_fat")
    private Float cookFat;

    /**
     * 蛋白质/克
     */
    @TableField("cook_protein")
    private Float cookProtein;

    /**
     * 膳食纤维/克
     */
    @TableField("cook_df")
    private Float cookDf;

    /**
     * 碳水化合物/克
     */
    @TableField("cook_carbohydrate")
    private Float cookCarbohydrate;

    /**
     * 胆固醇/毫克
     */
    @TableField("cook_cholesterin")
    private Float cookCholesterin;

    /**
     * 材料调料：例子：胡萝卜-5克|黄瓜-3克|盐-半勺
     */
    @TableField("cook_material")
    private String cookMaterial;

    /**
     * 做法
     */
    @TableField("cook_practice")
    private String cookPractice;

    /**
     * 健康知识
     */
    @TableField("cook_health")
    private String cookHealth;

    /**
     * 菜品标签
     */
    @TableField("cook_tips")
    private String cookTips;

    /**
     * 菜谱分类
     */
    @TableField("cook_categoryId")
    private Integer cookCategoryid;

    /**
     * 创建人
     */
    @TableField("cook_creater")
    private String cookCreater;

    /**
     * 创建时间
     */
    @TableField("cook_create_time")
    private Date cookCreateTime;

    /**
     * 最后编辑人
     */
    @TableField("cook_editor")
    private String cookEditor;

    /**
     * 最后编辑时间
     */
    @TableField("cook_edit_time")
    private Date cookEditTime;

    /**
     * 删除人
     */
    @TableField("cook_deleter")
    private String cookDeleter;

    /**
     * 删除时间
     */
    @TableField("cook_del_time")
    private Date cookDelTime;

    /**
     * 菜谱URL
     */
    @TableField("cook_url")
    private String cookUrl;

    @TableField("cook_thumb")
    private String cookThumb;

    /**
     * 材料
     */
    @TableField("cook_food")
    private String cookFood;

    /**
     * 调料
     */
    @TableField("cook_season")
    private String cookSeason;

    /**
     * 常见类型（可多选）：1-早餐,2-午餐,3-晚餐
     */
    @TableField("cook_common_type")
    private String cookCommonType;

    public DtrdExtEmsYwCookbooks init() {
        isDel = 0;
        cookCreateTime = new Date();
        return this;
    }

    public DtrdExtEmsYwCookbooks parseFromDto(CookbooksDetail dto) {
        dataId = dto.getDataId();
        cookName = dto.getCookName();
        cookKcal = dto.getCookKcal();
        cookFat = dto.getCookFat();
        cookProtein = dto.getCookProtein();
        cookDf = dto.getCookDf();
        cookCarbohydrate = dto.getCookCarbohydrate();
        cookCholesterin = dto.getCookCholesterin();
        cookMaterial = dto.getCookMaterial();
        cookPractice = dto.getCookPractice();
        cookHealth = dto.getCookHealth();
        cookTips = dto.getCookTips();
        cookCategoryid = dto.getCookCategoryid();
        cookUrl = dto.getCookUrl();
        cookThumb = dto.getCookThumb();
        cookFood = dto.getCookFood();
        cookSeason = dto.getCookSeason();
        cookCommonType = dto.getCookCommonType();
        return this;
    }


}
